﻿using System;
using System.Linq;

namespace MusicPlayer
{
    interface ICoreCommands
    {
        event EventHandler<BaseCoreArgs> OnPlay;
        event EventHandler<BaseCoreArgs> OnPause;
        event EventHandler<BaseCoreArgs> OnStop;

        event EventHandler<BaseCoreArgs> OnPrevious;
        event EventHandler<BaseCoreArgs> OnNext;

        event EventHandler<VolumeChangeEventArgs> OnVolumeChange;

        event EventHandler<BaseCoreArgs> OnMute;

        //event EventHandler<PlayerChangeArgs> OnPlayerChange;
        event EventHandler<DriverChangeArgs> OnDriverChange;
    }

    class BaseCoreArgs : EventArgs
    {
        public int TargetPlayer { get; set; }

        public BaseCoreArgs(int targetPlayer)
        {
            this.TargetPlayer = targetPlayer;
        }
    }

    class VolumeChangeEventArgs : BaseCoreArgs
    {
        private double volume;

        public double NewVolume 
        { 
            get
            {
                return this.volume;
            }
            set
            {
                this.volume = value;
            }
        }

        public VolumeChangeEventArgs(int targetPlayer, double newVolume)
            : base(targetPlayer)
        {
            this.NewVolume = newVolume;
        }
    }

    class PlayerChangeArgs : BaseCoreArgs
    {
        public int NewPlayer { get; set; }

        public PlayerChangeArgs(int targetPlayer, int newPlayer)
            : base(targetPlayer)
        {
            this.NewPlayer = newPlayer;
        }
    }

    class DriverChangeArgs : BaseCoreArgs
    {
        public int NewDriver { get; set; }

        public DriverChangeArgs(int targetPlayer, int newDriver)
            : base(targetPlayer)
        {
            this.NewDriver = newDriver;
        }
    }
}
